import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/product_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/product_entity.g.dart';

/// 产品实体
@JsonSerializable()
class ProductEntity implements ChoiceBean{

	ProductEntity();

	factory ProductEntity.fromJson(Map<String, dynamic> json) => $ProductEntityFromJson(json);
	/// 箱含量
	double? boxContent = 0;

	/// 组合发数
	int? combinationQuantity = 0;

	///	组合类型
	String? combinationType = '';

	/// 组合类型名
	String? combinationTypeName = '';

	///	企业code
	String? companyCode = '';

	///	创建人id
	String? createBy = '';

	///	创建人姓名
	String? createByName = '';

	///	创建时间
	String? createDate = '';

	///	正常0，已删除1
	String? deleted = '';

	///	单筒药量 单位g
	double? dosage = 0;

	///	燃放效果
	String? firingEffects = '';

	///	燃放效果名
	String? firingEffectsName = '';

	///	主键id
	String? id = '';

	///	产品存储在仓库的总量（库存）
	int? inventory = 0;

	///	单个仓库库存最小量提醒（件）
	int? minStorage = 0;

	///	最低年龄要求
	int? minimumAgeRequirement = 0;

	///	产品名称
	String? name = '';

	///	毛重
	double? netWeight = 0;

	///	产品类别
	String? productCategory = '';

	///	产品类别名
	String? productCategoryName = '';

	///	产品级别
	String? productLevel = '';

	///	产品级别名
	String? productLevelName = '';

	///	长
  double? productLong = 0;

	///	产品供应商
	String? productSupplier = '';

	///	高
  double? productTall = 0;

	///	宽
  double? productWidth = 0;

	///	安全距离
	String? safeDistance = '';

  ///	安全距离名
  String? safeDistanceName = '';

	///	总药量
  double? totalDosage = 0;

	///	视频地址
	String? videoUrl = '';

	///	体积
	double? volume = 0;

	///	仓库名称
	String? wareHouseName = '';

	///	仓库ID
	String? warehouseId = '';

  /// 是否选中
  bool isChecked = false;

	Map<String, dynamic> toJson() => $ProductEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}


  @override
  String getId() {
    return id!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  String getShowName() {
    return name!;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }
}
